<#assign title="releases" />
<#assign activeTitle="release" />
<#include "/frag.head.ftl">
<link rel="stylesheet" href="${s3('/jqGrid/5.3.1/css/ui.jqgrid-bootstrap.css')}">
<div class="row">
  <div class="col-xs-12">
    <div id="toolbar">
      <!--
      <button type="button" class="btn btn-primary" onclick="newProject();"><i class="fa fa-plus"></i>Add</button>
      -->
      &nbsp;
    </div>
  </div>
  <div class="col-xs-12">
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
  </div>
</div>
<#include "/frag.foot.ftl">
<script src="${s3('/jqGrid/5.3.1/js/jquery.jqGrid.min.js')}"></script>
<script src="${s3('/jqGrid/5.3.1/js/i18n/grid.locale-cn.js')}"></script>
<script type="text/javascript">

  $(document).ready(function () {


    $("#jqGrid").jqGrid({
      url: '/releases.json',
      mtype: "post",
      datatype: "json",
      autowidth: true,
      shrinkToFit: true,
      styleUI: 'Bootstrap',
      colModel: [
        {label: 'sha-1', name: 'sha', key: true, sortable: false},
        {label: 'msg', name: 'msg', sortable: false},
        {label: 'oper', name: 'oper', sortable: false},
        {label: 'time', name: 'create_at', sortable: false, formatter: numdate },
        {
          label: 'action',
          sortable: false,
          formatter: function (cell, options, row) {
            var actions = [];
            actions.push('<button class="btn btn-danger btn-sm" onclick="Revoke(\'' + row.sha + '\');">Revoke</button>&nbsp;');
            return actions.join('');
          }
        }
      ],
      viewrecords: true,
      height: '100%',
      rowNum: 10,
      pager: "#jqGridPager"
    });
  });

</script>